#ifndef __MQTT_H
#define __MQTT_H

#include <stdint.h>

#define MQTT_CLIENTID			"ikbyfDgmt8e.D001|securemode=2,signmethod=hmacsha256,timestamp=1687530426086|"
#define MQTT_USERNAME			"D001&ikbyfDgmt8e"
#define MQTT_PASSWORD			"80f3633cad2b2b668ea8c70933afe3fb0041f35bd8a645a59d080cb593fe39bf"

typedef struct {
	uint8_t pack_buff[512];				/* 构建报文缓冲区 */
	uint16_t message_id;				/* 报文标识符 */
	uint16_t fixed_header_len;			/* 固定头长度 */
	uint16_t variable_header_len;		/* 可变头长度 */
	uint16_t payload_len;				/* 有效载荷长度 */
	uint16_t remaining_len;				/* 剩余长度 */
} mqtt_struct;

void mqtt_connect_package(void);
void mqtt_publish(char *topic, char *data);

#endif
